<?php
return [
    'tj' => [
        'order' => /** @lang text */
            <<<EOL
select
    sum(order_product_price*order_product_num) as totalSalePrice,
    sum(order_product_num) as totalSaleCount,
    count(*) as totalOrderCount,
    sum(if(order_pay_time>=:day,order_product_price*order_product_num,null)) as daySalePrice,
    sum(if(order_pay_time>=:day,order_product_price*order_product_num,null)) as daySaleCount,
    count(if(order_pay_time>=:day,1,null)) as dayOrderCount,
    sum(if(order_pay_time>=:month,order_product_price*order_product_num,null)) as monthSalePrice,
    sum(if(order_pay_time>=:month,order_product_num,null)) as monthSaleCount,
    count(if(order_pay_time>=:month,1,null)) as monthOrderCount,
    sum(if(order_pay_time>=:year,order_product_price*order_product_num,null)) as yearSalePrice,
    sum(if(order_pay_time>=:year,order_product_num,null)) as yearSaleCount,
    count(if(order_pay_time>=:year,1,null)) as yearOrderCount
from shop_order
where order_status=1 and sell_user_id=:userId and order_is_delete in(0,2) limit 1
EOL,
        'user' => /** @lang text */
            <<<EOL
select
    count(*) as totalCount,
    count(if(created_at>=:day,1,null)) as dayCount,
    count(if(created_at<:day&&created_at>=:day,1,null)) as lastDayCount,
    count(if(created_at>=:month,1,null)) as monthCount,
    count(if(created_at<:month&&created_at>=:lastMonth,1,null)) as lastMonthCount,
    count(if(created_at>=:year,1,null)) as yearCount,
    count(if(created_at<:year&&created_at>=:lastYear,1,null)) as lastYearCount
from shop_user where user_type=2
EOL,
        'auctionNum' => /** @lang text */
            <<<EOL
select
count(if(status=1 && audit_status=1 && expired=0 && sell_out=0,1,null)) as publishCount,
count(if(status=0,1,null)) as draftCount,
count(if(sell_out=1,1,null)) as sellOutCount,
count(if(expired=1,1,null)) as expiredCount,
count(if(audit_status=0 && status=1,1,null)) as auditStatus
from auction where publish_id=:userId and deleted_at is null
EOL,
    ],
];
